package com.example;

import com.example.utils.MyBatisUtil;
import org.junit.jupiter.api.Test;
import com.example.entity.User;
import com.example.mapper.UserMapper;
import org.apache.ibatis.session.SqlSession;


public class MyBatisTest {
    @Test
    public void testGetBillList() {
        SqlSession sqlSession = null;
        User user = new User();
        try {
            sqlSession = MyBatisUtil.createSqlSession();
            user = sqlSession.getMapper(UserMapper.class).selectUserById(1);
            System.out.println(user);
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }finally{
            MyBatisUtil.closeSqlSession(sqlSession);
        }

    }
}